unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, MemDS, DBAccess, Uni, Grids, DBGrids, RzButton, ExtCtrls, RzPanel,
  UniProvider, OracleUniProvider, RzRadChk;

type
  TForm1 = class(TForm)
    DBGrid1: TDBGrid;
    UniConnection1: TUniConnection;
    UniDataSource1: TUniDataSource;
    UniQuery1: TUniQuery;
    RzToolbar1: TRzToolbar;
    RzToolButton1: TRzToolButton;
    OracleUniProvider1: TOracleUniProvider;
    RzToolButton2: TRzToolButton;
    ChkBox_Direct: TRzCheckBox;
    RzToolButton3: TRzToolButton;
    procedure RzToolButton1Click(Sender: TObject);
    procedure RzToolButton2Click(Sender: TObject);
    procedure RzToolButton3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.RzToolButton1Click(Sender: TObject);
begin
//  UniConnection1.Server:='60.191.73.107:1521:JGCZCS';
//  UniConnection1.SpecificOptions.Clear;
//  UniConnection1.SpecificOptions.Add('Oracle.Direct=True');

  if ChkBox_Direct.Checked then
  begin
    UniConnection1.Server:='60.191.73.107:1521:JGCZCS';
    UniConnection1.SpecificOptions.Clear;
    UniConnection1.SpecificOptions.Add('Oracle.Direct=True');
  end else
  begin
    UniConnection1.Server:='JGCZCS_60.191.73.107';
    UniConnection1.SpecificOptions.Clear;
  end;

  UniQuery1.Close;
  UniQuery1.SQL.Clear;
  UniQuery1.SQL.Add('SELECT * FROM JGCZ_ZBSJ');
  UniQuery1.Open;
  Self.Caption:=Format('%D',[UniQuery1.RecordCount]);
end;

procedure TForm1.RzToolButton2Click(Sender: TObject);
begin
  ShowMessage(UniConnection1.Server);
end;

procedure TForm1.RzToolButton3Click(Sender: TObject);
begin
  UniQuery1.Close;
end;

end.
